export let song_url = {
  namespaced: true,
  state: {
    song_url_data: {}
  },
  actions: {
    getSongUrlData(store, data = {}) {
      let url = "/song/url?id=" + data.id + "&br=" + data.br;
      return new Promise((resolve, reject) => {
        axios.get(url).then(({
          data
        }) => {
          store.commit('setSongUrlData', data);
          resolve(data);
        }).catch((error) => {
          if (error.response) {
            reject(error.response.data);
          }
        });
      });
    }
  },
  mutations: {
    setSongUrlData(state, data = {}) {
      state.song_url_data = data;
    }
  }
}
